package com.twu.biblioteca.command;

import com.twu.biblioteca.model.Customer;
import com.twu.biblioteca.domain.Library;

public class ShowCustomerMsgCommand extends Command {

    private Library library;

    public ShowCustomerMsgCommand(Library library) {
        this.library = library;
    }

    @Override
    public String execute() {
        Customer customer = library.getLoginInCustomer();
        if (customer != null) {
            String UserMsg = "Id:" + customer.getUserId() + "\n" +
                    "Name:" + customer.getName() + "\n" +
                    "Addr:" + customer.getAddress() + "\n" +
                    "Email:" + customer.getEmail() + "\n" +
                    "Phone:" + customer.getPhoneNum();
            return UserMsg;
        }
        return "sorry,you do not login ,can not see you inform";
    }
}
